<%@ page contentType="text/html;charset=utf-8" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@include file="./common/base.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户中心_约导游</title>
<!--css-->
<link rel="stylesheet" type="text/css" href="css/wutongstyle.css">
<script src="js/page.js" type="text/javascript"></script>

</head>

<body>
<!--head begin-->
<%@ include  file="./common/header.jsp"%>
<!--nav end--> 
<!--content begin-->
<div class="wt_content">
  <dl class="yuedaoyou">
    <dd>
      <div class="daoyou_info clearfix">
        <div class="xx_box">
          <div class="tainfobox yonghu">
            <h3 id="tuan"><i class="i_co"></i>已审核用户列表</h3>
            <div class="tainfo">
              <ul class="daituan2" id="userTuanId">
                <!--  -->
              </ul>
              <!-- 分页 start -->
              <div class="n_page clearfix">
                <ul id="1_fenyeId">
                  
                </ul>
              </div>
               <!-- 分页 end -->
            </div>
          </div>
        </div>
          <div class="tel">
            <h4>快捷菜单</h4>
            <ul class="quick">
              <li><a href="adminlogin.jsp" >新申请</a></li>
              <li><a href="adminlogin_1.jsp" class="on">已审核</a></li>
              <li><a href="adminletter_4.jsp" >系统消息</a></li>
              <li><a href="adminModifyPass.jsp">修改密码</a></li>
            </ul>
          </div>
        </div>
    </dd>
  </dl>
</div>
<!--content end--> 
<!--footer begin-->
<%@ include  file="./common/footer.jsp"%>
<!--footer end-->
</body>
<script type="text/javascript">
var pageIndex=1;
var pageSize=10;
var pageCount = 0;
var recordCount = 0;
//var totalPage=0;
//var totalCount=0;

$(function(){
	loadAccountList(pageIndex,pageSize);
});
function loadAccountList(ppageIndex,ppageSize) {
	var lxspageIndex =ppageIndex;
	var lxspageSize = ppageSize;
	var objp= "{\"pageIndex\":\""+(lxspageIndex-1)+"\","+
		         "\"pageSize\":\""+lxspageSize+"\","+
		         "\"status\":\""+1+"\""+
		         "}";
	   $.ajax({
			  url: '${path}/core/getAccountList',
			  type: 'POST',
			  timeout: 30000,
			  cache : false,
		      data :objp,
		      async: false,
		      dataType:"json",      
	          contentType:"application/json",   
		     // contentType: "application/json; charset=utf-8",
			  success:function(msg){
				  //alert(msg.totalCount)
				  formatAccountList(msg.dataList);
				  formatFenYe(msg.totalCount);
			  },
			   failure:function(msg){
				   alert(eval('('+msg.responseText+')').error_text);
			   		
			   },
			   error:function(msg){
				   alert(eval('('+msg.responseText+')').error_text); 
			   }
		});
}

function formatAccountList(dataList) {
	var ulDiv =$("#userTuanId");
		ulDiv.empty();
		for(var k=0;k<dataList.length;k++) {
			var shenfen = "未知";
			var  showStr= "<a href=\"dyinfo.jsp?guideId="+dataList[k].id+"\" class=\"renzheng\" style=\"cursor:pointer\">【查看用户详情】</a>";
			if(dataList[k].userType==0){
				shenfen = "旅行社";
				 showStr= "<a href=\"lxsinfo.jsp?travelorgId="+dataList[k].id+"\" class=\"renzheng\" style=\"cursor:pointer\">【查看用户详情】</a>";
			}else if(dataList[k].userType==1) {
				shenfen = "网友";
				showStr= "<a href=\"grinfo.jsp?personalId="+dataList[k].id+"\" class=\"renzheng\" style=\"cursor:pointer\">【查看用户详情】</a>";
			}else if(dataList[k].userType==2) {
				shenfen = "导游";
			}
			ulDiv.append("<li>"+
			                  //"<div class=\"tupian\"><a href=\"lxinfo.html\"><img src=\"image/1234.jpg\" height=\"160px\" width=\"219px\"/></a></div> "+
			                  "<span>用户名："+dataList[k].userName+" | 密码:"+dataList[k].showPass+"  | 身份:"+shenfen+" |状态:已通过"+" | 注册时间："+dataList[k].ctime+" "+" | 审核时间："+dataList[k].mtime+"---------"+showStr+""+
			                 "</li><br>");
		}
}



function formatFenYe(totalCount){
	 recordCount = totalCount;
	 pageCount = Math.ceil(recordCount/pageSize);
	 pageRefresh(function () { 
		 loadAccountList(pageIndex,pageSize);
	 });
}


</script>
</html>
